﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WFramework.MvcPager;
using MiniWeb.Core.Dtos;
using MiniWeb.Core.Entities;
using MiniWeb.Dao;
using WFramework.ORM;

namespace MiniWeb.Task
{
    public class LinksTask
    {
        private readonly LinksDao _dao = new LinksDao();
        public PagedList<Links> GetPagedList(int? id, string linkName,  int pageIndex, int pageSize)
        {
            return _dao.GetPageList(id, linkName, pageIndex, pageSize);
        }
        public List<Links> GetList() 
        {
            return _dao.GetList();
        }


        public Links GetById(int id)
        {

            return _dao.GetById(id);
        }
        public Links GetByName(string linkName)
        {
            return _dao.GetByName(linkName);
        }

        public void Delete(int id)
        {

            _dao.Delete(id);
        }

        public void Add(Links model) 
        {
            _dao.Add(model);
        }
        public void UpData(Links model)
        {
            _dao.Update(model);
        }
    }
}
